package com.ts.host;

import android.app.Activity;
import android.app.SearchManager.OnCancelListener;
import android.content.DialogInterface;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Toast;

import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.rio.core.U;
import com.rio.layout.LayoutManager;
import com.rio.layout.view.AbsLayout;
import com.rio.layout.view.SimpleLayout;
import com.rio.volley.RequestManager;

public abstract class TLayout extends AbsLayout {
	

	@Override
	public void onDisplay(String callerName, View view, int frag,
			Object... params) {
		super.onDisplay(callerName, view, frag, params);
	}

	
	@Override
	public String getName() {
		// TODO Auto-generated method stub
		return U.getName(getClass());
	}
	@Override
	public long onHide(String nextName) {
		return super.onHide(nextName);
	}

	public <T extends View> T findViewById(int id) {
		return U.findViewById(getView(), id);
	}



	/**
	 * 通过开关设置是否显示VIEW
	 * 
	 * @param switchName
	 * @param viewId
	 * @param trueMode
	 *            开关为真 显示的状态
	 */
	public void setVisibility(boolean switchValue, int viewId, int trueMode,
			int falseMode) {
		if (isLayoutAttach()) {
			if (switchValue) {
				findViewById(viewId).setVisibility(trueMode);
			} else {
				findViewById(viewId).setVisibility(falseMode);
			}
		}
	}

}
